class Panel{
  score = 0
  level = 1
  scoreEl: HTMLElement
  levelEl: HTMLElement
  upScore: number
  maxLevel: number
  constructor(upScore: number=10,maxLevel: number=10) {
    this.scoreEl = document.querySelector('.score>p') as HTMLElement
    this.levelEl = document.querySelector('.level>p') as HTMLElement
    this.upScore = upScore
    this.maxLevel = maxLevel
  }

  addScore() {
    this.scoreEl.innerHTML = ++this.score + ''
    if(this.level <= this.maxLevel){
      this.level = Math.floor(this.score / this.upScore) + 1
      this.levelEl.innerHTML = this.level + ''
    }
  }
}

export default Panel